﻿using ProTrack.Dto;
using ProTrack.Entity;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace ProTrack.IServices.Stock
{
    /// <summary>
    /// 生产领料业务逻辑层接口
    /// </summary>
    public interface IOrderProductPickServices
    {
        /// <summary>
        /// 获取所有生产领料信息
        /// </summary>
        /// <returns></returns>
        public Task<IEnumerable<OrderProductPick>> GetAllAsync();
        /// <summary>
        /// 根据页码，页大小，生产领料编号，领料日期，领料仓库，经办人，订单状态获取生产领料信息
        /// </summary>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页大小</param>
        /// <param name="Number">生产领料编号</param>
        /// <param name="PickDate">领料日期</param>
        /// <param name="WarehouseName">领料仓库</param>
        /// <param name="EmployeesName">经办人</param>
        /// <param name="Status">订单状态</param>
        /// <returns></returns>
        public Task<IEnumerable<OrderProductPick>> GetAsync(int PageIndex, int PageSize, string Number, string PickDate,string WarehouseName,string EmployeesName,int? Status);
        /// <summary>
        /// 根据生产领料编号，领料日期，领料仓库，经办人，订单状态获取总条数
        /// </summary>
        /// <param name="Number">生产领料编号</param>
        /// <param name="PickDate">领料日期</param>
        /// <param name="WarehouseName">领料仓库</param>
        /// <param name="EmployeesName">经办人</param>
        /// <param name="Status">订单状态</param>
        /// <returns></returns>
        public Task<int> GetCountAsync(string Number, string PickDate, string WarehouseName, string EmployeesName, int? Status);
        /// <summary>
        /// 根据生产领料编号和仓库编号获取生产领料明细表
        /// </summary>
        /// <param name="OrderProductPickId">生产领料编号</param>
        /// <param name="WareHouseId">仓库编号</param>
        /// <returns></returns>
        public Task<IEnumerable<OrderProductPickItemDto>> GetOrderProductPickbyIdAsync(string OrderProductPickId,string WareHouseId);
        /// <summary>
        /// 更新生产领料
        /// </summary>
        /// <param name="model">生产领料模型</param>
        /// <param name="list">生产领料明细模型</param>
        /// <returns></returns>
        public Task<bool> UpdateAsync(OrderProductPick model, List<OrderProductPickItem> list);
        /// <summary>
        /// 新增生产领料
        /// </summary>
        /// <param name="model">生产领料模型</param>
        /// <param name="list">生产领料明细模型</param>
        /// <returns></returns>
        public Task<bool> AddAsync(OrderProductPick model, List<OrderProductPickItem> list);
        /// <summary>
        /// 根据编号批量删除生产领料信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Task<bool> DeleteAsync(int[] Ids);
        /// <summary>
        /// 根据编号删除指定生产领料信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Task<bool> DeleteAsync(int Id);
        /// <summary>
        /// 根据仓库编号和产品编号查询BOM组成
        /// </summary>
        /// <param name="WareHouseId">仓库编号</param>
        /// <param name="ItemId">产品编号</param>
        /// <returns></returns>
        public Task<IEnumerable<OrderProductPickItemDto>> GetBomItembyId(string WareHouseId, string ItemId);
        /// <summary>
        /// 修改单据状态
        /// </summary>
        /// <param name="Id">单据Id</param>
        /// <param name="Status">状态：0待审核 1已审核</param>
        /// <returns></returns>
        public Task<bool> UpdateStatus(long Id, int Status);
    }
}
